#pragma once

#include <QString>
#include <QDateTime>
#include <QJsonObject>

namespace MISystem
{
    class MaterialStock
    {
    public:
        MaterialStock();
        MaterialStock(const QString& id, const QString& name, int quantity,
            const QString& location, const QDateTime& createTime);

        QString getMaterialId() const;
        QString getMaterialName() const;
        int getStockQuantity() const;
        QString getLocation() const;
        QDateTime getCreateTime() const;

        void setMaterialName(const QString& name);
        void setStockQuantity(int quantity);
        void setLocation(const QString& location);

        QJsonObject toJson() const;
        static MaterialStock fromJson(const QJsonObject& json);

    private:
        QString _materialId;
        QString _materialName;
        int _stockQuantity;
        QString _location;
        QDateTime _createTime;
    };
}
